package com.example.backstage.config;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.zaxxer.hikari.HikariDataSource;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.sql.DataSource;

@Configuration
public class BeanConfig {
    @Bean
    public DataSource dataSource(){
        HikariDataSource hikari = new HikariDataSource();
        hikari.setJdbcUrl("JDBC:mysql://localhost:3306/study");
        hikari.setUsername("root");
        hikari.setPassword("123456");
        hikari.setDriverClassName("com.mysql.cj.jdbc.Driver");
        return hikari;
    }

    @Bean
    public ObjectMapper Json(){
        return new ObjectMapper();
    }
}
